//
//  Circumibility.m
//  Uang Pasti
//
//  Created by 李永彬 on 2025/8/21.
//

#import "Circumibility.h"
#import "MJExtension.h"

@implementation Circumibility


+ (NSDictionary *)mj_objectClassInArray {
    return @{
        @"leaderible" : [LeaderibleModel class]
    };
}

+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{
        @"tergmost" : @"tergmost",
        @"leaderible" : @"leaderible"
    };
}

+ (instancetype)mj_objectWithKeyValues:(id)keyValues {
    // 先让 MJExtension 进行常规转换
    Circumibility *circumibility = [super mj_objectWithKeyValues:keyValues];
    
    // 特殊处理 leaderible 属性
    id leaderibleValue = [keyValues valueForKey:@"leaderible"];
    if (leaderibleValue) {
        if ([leaderibleValue isKindOfClass:[NSDictionary class]]) {
            // 如果是字典，转换为单个对象
            LeaderibleModel *singleModel = [LeaderibleModel mj_objectWithKeyValues:leaderibleValue];
            circumibility.leaderible = @[singleModel];
        } else if ([leaderibleValue isKindOfClass:[NSArray class]]) {
            // 如果是数组，正常转换
            circumibility.leaderible = [LeaderibleModel mj_objectArrayWithKeyValuesArray:leaderibleValue];
        }
    }
    
    return circumibility;
}

@end
